]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Background: allow passing the settings schema from outside
authorGiovanni Campagna <gcampagna@src.gnome.org>
Mon, 19 Aug 2013 22:48:56 +0000 (00:48 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Tue, 20 Aug 2013 12:11:44 +0000 (14:11 +0200)
This way it is possible to use different settings for different
backgrounds.

https://bugzilla.gnome.org/show_bug.cgi?id=688210

js/ui/background.js

index 1d9ab7c210395a480ddbc0afff3d153844a66e46..246060a88e94685119479582df08c6d7235f922b 100644 (file)
@@ -295,14 +295,15 @@ const Background = new Lang.Class({
     _init: function(params) {
         params = Params.parse(params, { monitorIndex: 0,
                                         layoutManager: Main.layoutManager,
-                                        effects: Meta.BackgroundEffects.NONE });
+                                        effects: Meta.BackgroundEffects.NONE,
+                                        settings: null });
         this.actor = new Meta.BackgroundGroup();
         this.actor._delegate = this;
 
         this._destroySignalId = this.actor.connect('destroy',
                                                    Lang.bind(this, this._destroy));
 
-        this._settings = new Gio.Settings({ schema: BACKGROUND_SCHEMA });
+        this._settings = params.settings;
         this._monitorIndex = params.monitorIndex;
         this._layoutManager = params.layoutManager;
         this._effects = params.effects;
@@ -716,8 +717,10 @@ const BackgroundManager = new Lang.Class({
                                         layoutManager: Main.layoutManager,
                                         monitorIndex: null,
                                         effects: Meta.BackgroundEffects.NONE,
-                                        controlPosition: true });
+                                        controlPosition: true,
+                                        settingsSchema: BACKGROUND_SCHEMA });
 
+        this._settings = new Gio.Settings({ schema: params.settingsSchema });
         this._container = params.container;
         this._layoutManager = params.layoutManager;
         this._effects = params.effects;
@@ -776,7 +779,8 @@ const BackgroundManager = new Lang.Class({
     _createBackground: function() {
         let background = new Background({ monitorIndex: this._monitorIndex,
                                           layoutManager: this._layoutManager,
-                                          effects: this._effects });
+                                          effects: this._effects,
+                                          settings: this._settings });
         this._container.add_child(background.actor);
 
         let monitor = this._layoutManager.monitors[this._monitorIndex];